module(
    name = "rules_tar",
    version = "1.0.0",
    bazel_compatibility = [
        ">=7.0.0",
    ],
    compatibility_level = 1,
)

bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_coreutils", version = "1.0.1")
bazel_dep(name = "rules_gzip", version = "1.0.0")
bazel_dep(name = "rules_bzip2", version = "1.0.0")
bazel_dep(name = "rules_zstd", version = "1.0.0")
bazel_dep(name = "rules_xz", version = "1.0.0")
bazel_dep(name = "toolchain_utils", version = "1.0.2")
bazel_dep(name = "ape", version = "1.0.1")
bazel_dep(name = "rules_go", version = "0.49.0")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "gazelle", version = "0.38.0")

bazel_dep(name = "hermetic_cc_toolchain", version = "3.1.0", dev_dependency = True)

export = use_extension("@toolchain_utils//toolchain/export:defs.bzl", "toolchain_export")
use_repo(export, "ape-tar")
export.symlink(
    name = "tar",
    target = "@ape-tar",
)
use_repo(export, "tar")

resolved = use_repo_rule("@toolchain_utils//toolchain/resolved:defs.bzl", "toolchain_resolved")

[
    resolved(
        name = "resolved-{}".format(toolchain),
        toolchain_type = "//tar/toolchain/{}:type".format(toolchain),
    )
    for toolchain in ("tar", "concatenate", "filter")
]

register_toolchains("//tar/toolchain/...")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
    go_deps,
    "com_github_bmatcuk_doublestar_v4",
    "com_github_dsnet_compress",
    "com_github_h2non_filetype",
    "com_github_klauspost_compress",
    "com_github_ulikunitz_xz",
)
